The RAW Plugin is a tool for serving files on your Web site that contain HTTP protocol headers in addition to file data (known as "RAW files"). This allows Web site administrators to send customized headers to Web browsers, which in certain situations can improve the Web browsing experience. Before attempting to add RAW files to your site, be sure to familiarize yourself with the HTTP protocol. Documentation on this Internet standard can be found in various books or on the Web at: http://www.cis.ohio-state.edu/htbin/rfc/rfc2068.html
What is the RAW Plugin?
Normally when AppleShare IP’s Web server serves files, it first sends HTTP protocol headers, followed by file data. Below is what might be sent for the ‘AppleShareIP.gif’ file that is installed by default in the Web folder when AppleShare IP is first installed:
HTTP/1.1 200 OK
Date: Tue, Jan 3, 1998 14:15:16 GMT
Server: AppleShareIP/6.1
Content-Length: 5834
Content-Type: image/gif
Last-Modified: Tue, Dec 26, 1998 20:06:19 GMT
After sending this information, the server sends the contents of the file. Browsers use the header information to properly present the data to whoever is viewing your Web site. For instance, in the above example the Content-Type header tells the browser that the data should be displayed as a picture. The format for this header is part of the HTTP protocol, an agreed upon Internet standard.
Most of the time, administrators do not need to know or care about this header; it is simply an automatic function of the Web server. However, in certain cases, the ability to directly manipulate it can be a powerful tool for improving the quality of a Web site (see Understanding the Redirect Example, below). That is where the RAW Plugin comes in.
With the RAW Plugin installed, any file in your Web site with a suffix of ‘.raw’ will be sent to the browser without first appending the HTTP headers. That means that the file itself must contain them. Because the headers are inside the file itself, you are free to modify them as you wish with a text editor such as SimpleText.
Installation Instructions
Drag the RAW Plugin into the Plug-Ins folder of your Web site. This is a folder named Plug-Ins located directly inside the default Web folder.
The next time the AppleShare IP Web & File server starts up, the RAW Plugin will become active, and all files with a suffix of .raw will be served as RAW files.
MIME type Configuration
When the AppleShare IP Web & File server starts up, the RAW Plugin automatically adds the following suffix mapping to the server’s MIME type table:
suffix file type file creator action
.raw * * RAW Plugin
For details on exactly how MIME types work, see the AppleShare IP Administrator’s manual section on MIME types.
If you would like to add other suffix mappings that invoke the RAW Plugin (for instance, if you have RAW files with a suffix of ‘.rawfile’), follow the instructions in the Administrator’s manual for adding a new MIME type. For an action, select Execute. In the file dialog that appears, navigate to and select the RAW Plugin. Now the Web server will know to invoke the RAW Plugin when it receives URLs with your new suffix mapping.
Understanding the Redirect Example
Enclosed with the RAW Plugin is a file called Redirect.raw. This file is sample RAW file. Open this file from SimpleText. Note that the text within looks similar to the sample HTTP header above (see What is the RAW Plugin?).
After following the installation instructions for the RAW Plugin and launching the Web & File Server, place the Redirect.raw file inside your root Web folder. From a browser, enter the URL for your Web site, followed by Redirect.raw (ie. http://www.mysite.com/redirect.raw). Surprise! The AppleShareIP.jpg graphic should appear in the browser window, and the displayed URL should read http://www.mysite.com/AppleShareIP.jpg. The contents of the RAW file caused your browser to be "redirected" to this new URL.
A redirect is a special HTTP header that causes a browser to immediately jump to a new location on the Web. The Redirect.raw file contains this special header.
Open the Redirect.raw file in SimpleText once again. Note the header line labelled Location. On that same line, you should see the URL for the AppleShareIP.jpg file. This is header information that tells the browser to jump to that file.
The Location header can contain any URL on your site, or even any URL on the Web (the Location: http://www.apple.com is a valid location header that would redirect browsers to Apple’s Web site). Try changing the URL in the Redirect.raw file to other files on your Web site, then test your changes with a browser.
Redirects can be useful if you have moved content on your Web site, but you are worried that some links might still be pointing at the old location. In that case, putting a redirect in the old location to the new data would allow those out-of-date links to function.